package threadSafe.property;

public class ThreadTest {
	public static void main(String[] args) {
		Runnable runnable = new Runnable() {
			//Count count = new Count(); 
			public void run() {
				Count count = new Count(); 
				count.count();
			}
		};
		Runnable runnableAtomic = new Runnable() {
			//Count count = new Count(); 
			public void run() {
				Count.countAtomic();
			}
		};
		
		Runnable runnableAtomics = new Runnable() {
			//Count count = new Count(); 
			public void run() {
				Count count = new Count(); 
				count.countAtomicss();
			}
		};
		Runnable runnables = new Runnable() {
			Count count = new Count(); 
			public void run() { 
				count.counts();
			}
		};
		Count.addUser("shiqinag1#@#123456789",1);
		Count.addUser("shiqinag2#@#223456789",2);
		Count.addUser("shiqinag3#@#323456789",3);
		Count.addUser("shiqinag4#@#423456789",4);
		Count.addUser("shiqinag5#@#523456789",5);
		Count.addUser("shiqinag6#@#623456789",6);
		Count.addUser("shiqinag7#@#723456789",7); 
		Count.addUser("shiqinag8#@#823456789",8);
		Runnable counmap = new Runnable() {
			
			public void run() {  
				try {
					Count.getSameSessionUserNameStr("shiqinag#@#ssssss");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		};
		
//		for (int i = 0; i < 5; i++) {
//			new Thread(runnable).start(); 
//		}
//		
//		for (int i = 0; i < 8; i++) { 
//			new Thread(runnableAtomic).start();
//		}
//		for (int i = 0; i < 8; i++) { 
//			new Thread(runnableAtomics).start();
//		}
//		for (int i = 0; i < 8; i++) { 
//			new Thread(runnables).start();
//		}
		for (int i = 0; i < 18; i++) { 
			new Thread(counmap).start();
		}
	}
}